﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmailMarketingDao;
using Tool;

namespace EmailMarketingDomain
{
    public class QQPostOffice : ProxyPostOffice
    {
        private static QQPostOffice _qqPostOffice;
        private static readonly object _syncBoot = new object();
        private QQPostOffice()
        {
            var smtp = SmtpServerDao.GetEmailSmtpServcerByName("qq");
            Mailconfig=new Mail();
            Mailconfig.SmtpServer.Host = smtp.Server;
            Mailconfig.SmtpServer.Port = Convert.ToInt32(smtp.Port);
            Mailconfig.SmtpServer.EnableSsl = smtp.EnableSSL;
        }
        public static QQPostOffice GetInstance()
        {
            if (_qqPostOffice == null)
            {
                lock (_syncBoot)
                {
                    if (_qqPostOffice == null)
                    {
                        _qqPostOffice = new QQPostOffice();
                    }
                }
            }
            return _qqPostOffice;
        }
    }
}
